#include "stdio.h"
#include "math.h"
	int happy=0 , f3=0, l3=0, i=0, c1=0, c2=0, c3=0, c4=0, c5=0, c6=0, sum[1000], k=0;
	float p=0.f, zn;

int main(int argc, char* argv[])


{
	for(i=0; i<1000; i++)
	{
		c3=i%10;
		c2=(i%100-c6*1)/10;
		c1=(i%1000-(c5*10+c6*1))/100;  
        sum[i]=c1+c2+c3;
    }
	for (i=0; i<1000; i++)
	{
         
		for(k=0; k<1000; k++)
		{
                 if(sum[i]==sum[k])
                 {
                             happy=happy+1;
                 }
        }
	}
	printf("\n itogo s4astlivyh biletov polu4ilos` \n %i ", happy);
	p=(happy/1000000.)*100.;
    zn=100/p;                                                     
    printf("\n \n a ih dolya sostavila \n %3.4f ", p);
	putchar('%');
	printf("\n \n znaminatel` \n %3.4f \n ", zn);
    system("pause");
	

	return 0;
}
